package com.heima.minio.test;

import com.heima.file.service.FileStorageService;
import com.heima.minio.MInIOApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

@SpringBootTest(classes = MInIOApplication.class)
@RunWith(SpringRunner.class)
public class MinIOTest2 {


    @Autowired
    private FileStorageService fileStorageService;

    @Test
    public void testUploadImg() throws FileNotFoundException {
        FileInputStream fileInputStream = new FileInputStream("E:\\tmp\\ak47.jpg");
        String path = fileStorageService.uploadImgFile("", "ak47.jpg", fileInputStream);
        System.out.println(path);
    }


}
